import 'package:meta/meta.dart' show useResult;

// @useResult 标记方法的结果需要被使用到,否则就警告
class Person {
  final String firstName;
  final String lastName;

  const Person({
    required this.firstName,
    required this.lastName,
  });

  @useResult
  String fullName() => '$firstName $lastName';
}

void printFullName() {
  // 取消此处注释,就会出现警告
  // const Person(
  //   firstName: 'Foo',
  //   lastName: 'Bar',
  // ).fullName();

  final test = const Person(
    firstName: 'Foo',
    lastName: 'Bar',
  ).fullName();
  print(test);
}
